/*
Mingnan Liu	
Proposal title: An experiment testing six formats of 0 to 100 rating scales

HYPOTHESES

Stated-Hyp1: Response to thermometer questions will vary based on question wording and format. Case 1: whites 


	Test-Hyp1: There will be a difference in item-non-response in condition 1 vs. control. Case: Whites

	Test-Hyp2: There will be a difference in item-non-response in condition 2 vs. control. Case: Whites

	Test-Hyp3: There will be a difference in item-non-response in condition 3 vs. control. Case: Whites
	
	Test-Hyp4: There will be a difference in item-non-response in condition 4 vs. control. Case: Whites

	Test-Hyp5: There will be a difference in item-non-response in condition 5 vs. control. Case: Whites

	Test-Hyp6: There will be a difference in rounding rate in condition 1 vs. control. Case: Whites

	Test-Hyp7: There will be a difference in rounding rate in condition 2 vs. control. Case: Whites

	Test-Hyp8: There will be a difference in rounding rate in condition 3 vs. control. Case: Whites

	Test-Hyp9: There will be a difference in rounding rate in condition 4 vs. control. Case: Whites

	Test-Hyp10: There will be a difference in rounding rate in condition 5 vs. control. Case: Whites				
		
	Test-Hyp11: There will be a difference in response distribution in condition 1 vs. control. Case: Whites
	
	Test-Hyp12: There will be a difference in response distribution in condition 2 vs. control. Case: Whites
	

	Test-Hyp13: There will be a difference in response distribution in condition 3 vs. control. Case: Whites	

		
	Test-Hyp14: There will be a difference in response distribution in condition 4 vs. control. Case: Whites	

		
	Test-Hyp15: There will be a difference in response distribution in condition 5 vs. control. Case: Whites	


		
Stated-Hyp2: Response to thermometer questions will vary based on question wording and format. Case 2: Hispanics

	Test-Hyp16: There will be a difference in item-non-response in condition 1 vs. control. Case: Hispanics

	Test-Hyp17: There will be a difference in item-non-response in condition 2 vs. control. Case: Hispanics

	Test-Hyp18: There will be a difference in item-non-response in condition 3 vs. control. Case: Hispanics
	
	Test-Hyp19: There will be a difference in item-non-response in condition 4 vs. control. Case: Hispanics

	Test-Hyp20: There will be a difference in item-non-response in condition 5 vs. control. Case: Hispanics

	Test-Hyp21: There will be a difference in rounding rate in condition 1 vs. control. Case: Hispanics

	Test-Hyp22: There will be a difference in rounding rate in condition 2 vs. control. Case: Hispanics

	Test-Hyp23: There will be a difference in rounding rate in condition 3 vs. control. Case: Hispanics

	Test-Hyp24: There will be a difference in rounding rate in condition 4 vs. control. Case: Hispanics

	Test-Hyp25: There will be a difference in rounding rate in condition 5 vs. control. Case: Hispanics				
		
	Test-Hyp26: There will be a difference in response distribution in condition 1 vs. control. Case: Hispanics
	
	Test-Hyp27: There will be a difference in response distribution in condition 2 vs. control. Case: Hispanics
	

	Test-Hyp28: There will be a difference in response distribution in condition 3 vs. control. Case: Hispanics	

		
	Test-Hyp29: There will be a difference in response distribution in condition 4 vs. control. Case: Hispanics	

		
	Test-Hyp30: There will be a difference in response distribution in condition 5 vs. control. Case: Hispanics

Stated-Hyp3: Response to thermometer questions will vary based on question wording and format. Case 3: Blacks 

	Test-Hyp31: There will be a difference in item-non-response in condition 1 vs. control. Case: Blacks

	Test-Hyp32: There will be a difference in item-non-response in condition 2 vs. control. Case: Blacks

	Test-Hyp33: There will be a difference in item-non-response in condition 3 vs. control. Case: Blacks
	
	Test-Hyp34: There will be a difference in item-non-response in condition 4 vs. control. Case: Blacks

	Test-Hyp35: There will be a difference in item-non-response in condition 5 vs. control. Case: Blacks

	Test-Hyp36: There will be a difference in rounding rate in condition 1 vs. control. Case: Blacks

	Test-Hyp37: There will be a difference in rounding rate in condition 2 vs. control. Case: Blacks

	Test-Hyp38: There will be a difference in rounding rate in condition 3 vs. control. Case: Blacks

	Test-Hyp39: There will be a difference in rounding rate in condition 4 vs. control. Case: Blacks

	Test-Hyp40: There will be a difference in rounding rate in condition 5 vs. control. Case: Blacks				
		
	Test-Hyp41: There will be a difference in response distribution in condition 1 vs. control. Case: Blacks
	
	Test-Hyp42: There will be a difference in response distribution in condition 2 vs. control. Case: Blacks
	

	Test-Hyp43: There will be a difference in response distribution in condition 3 vs. control. Case: Blacks	

		
	Test-Hyp44: There will be a difference in response distribution in condition 4 vs. control. Case: Blacks	

		
	Test-Hyp45: There will be a difference in response distribution in condition 5 vs. control. Case: Blacks


********************************************************************************
NOTES	
- Cannot test hypotheses about response latency because measure was not included 
(i.e. time taken to respond to each question).

- Analysis plan specifies use of ANOVA. We use OLS for consistency across studies.

- One of the hypotheses pertains to the distribution of the rating measure. 
We use Kolmogorov-Smirnov test to compare distributions. Proposal didn't specify 
a test.
*/

clear 
use "LiuB33.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

* Treatment group: income tax, all tax, control
	tab xTess165
	recode xTess165 (1=1) (6=0) (*=.), gen(treat1)
	recode xTess165 (2=1) (6=0) (*=.), gen(treat2)
	recode xTess165 (3=1) (6=0) (*=.), gen(treat3)
	recode xTess165 (4=1) (6=0) (*=.), gen(treat4)
	recode xTess165 (5=1) (6=0) (*=.), gen(treat5)
	
* Question type
	replace QL1=. if QL1==-1
	replace QL2=. if QL2==-1
	replace QL3=. if QL3==-1	
	rename QL1 rating_white
	rename QL2 rating_hispanic
	rename QL3 rating_black

* OUTCOME MEASURES

* response latency
	// not measured

* item non-response
	tab rating_white, mis
	recode rating_white (0/100=0) (*=1), gen(nonresponse_white)
	recode rating_hispanic (0/100=0) (*=1), gen(nonresponse_hispanic)
	recode rating_black (0/100=0) (*=1), gen(nonresponse_black)
	
	tab nonresponse_white, mis
	tab nonresponse_hispanic, mis
	tab nonresponse_black, mis

* rounding rate
	foreach var in white black hispanic {
	gen rounded_`var'=. 
	replace rounded_`var'=1 if ///
	rating_`var'==0 | ///
	rating_`var'==5 | ///
	rating_`var'==10 | ///
	rating_`var'==15 | ///
	rating_`var'==20 | ///	
	rating_`var'==25 | ///	
	rating_`var'==30 | ///
	rating_`var'==35 | ///
	rating_`var'==40 | ///
	rating_`var'==45 | ///
	rating_`var'==50 | ///
	rating_`var'==55 | ///
	rating_`var'==60 | ///	
	rating_`var'==65 | ///	
	rating_`var'==70 | ///
	rating_`var'==75 | ///
	rating_`var'==80 | ///
	rating_`var'==85 | ///
	rating_`var'==90 | ///
	rating_`var'==95 | ///
	rating_`var'==100 
	replace rounded_`var'=0 if rounded_`var'!=1 & rating_`var'<101
	tab rounded_`var', mis
	}
	


	
********************************************************************************

* ANALYSIS
	

*	Test-Hyp1: There will be a difference in item-non-response in condition 1 vs. control. Case: Whites
	reg nonresponse_white i.treat1
	// reject.
	tess 1.treat1, init(LiuB33) bonf(2)
	
*	Test-Hyp2: There will be a difference in item-non-response in condition 2 vs. control. Case: Whites
	reg nonresponse_white i.treat2
	// reject. 
	tess 1.treat2, bonf(2)
	
*	Test-Hyp3: There will be a difference in item-non-response in condition 3 vs. control. Case: Whites
	reg nonresponse_white i.treat3
	// reject.	
	tess 1.treat3, bonf(2)
	
*	Test-Hyp4: There will be a difference in item-non-response in condition 4 vs. control. Case: Whites
	reg nonresponse_white i.treat4
	// reject.	
	tess 1.treat4, bonf(2)
		
*	Test-Hyp5: There will be a difference in item-non-response in condition 5 vs. control. Case: Whites
	reg nonresponse_white i.treat5
	// reject. 		
	tess 1.treat5, bonf(2)
		
*	Test-Hyp6: There will be a difference in rounding rate in condition 1 vs. control. Case: Whites
	reg rounded_white i.treat1
	// do not reject. 0.000
	tess 1.treat1, bonf(2)	

*	Test-Hyp7: There will be a difference in rounding rate in condition 2 vs. control. Case: Whites
	reg rounded_white i.treat2
	// do not reject. 0.000 		
	tess 1.treat2, bonf(2)
	
*	Test-Hyp8: There will be a difference in rounding rate in condition 3 vs. control. Case: Whites
	reg rounded_white i.treat3
	// do not reject. 0.000
	tess 1.treat3, bonf(2)

*	Test-Hyp9: There will be a difference in rounding rate in condition 4 vs. control. Case: Whites
	reg rounded_white i.treat4
	// do not reject. 0.000
	tess 1.treat4, bonf(2)
	

*	Test-Hyp10: There will be a difference in rounding rate in condition 5 vs. control. Case: Whites	
	reg rounded_white i.treat5
	// do not reject. 0.000	
	tess 1.treat5, bonf(2)			
	
*	Test-Hyp11: There will be a difference in response distribution in condition 1 vs. control. Case: Whites
	ksmirnov rating_white, by(treat1)
	// 	do not reject. 0.001
	tess rating_white treat1, ks 	
	
*	Test-Hyp12: There will be a difference in response distribution in condition 2 vs. control. Case: Whites
	ksmirnov rating_white, by(treat2)
	// 	do not reject. 0.000	
	tess rating_white treat2, ks 		
	
*	Test-Hyp13: There will be a difference in response distribution in condition 3 vs. control. Case: Whites	
	ksmirnov rating_white, by(treat3)
	// 	do not reject. 
	tess rating_white treat3, ks 	
	
*	Test-Hyp14: There will be a difference in response distribution in condition 4 vs. control. Case: Whites	
	ksmirnov rating_white, by(treat4)
	// 	do not reject. 0.028
	tess rating_white treat4, ks 
	
*	Test-Hyp15: There will be a difference in response distribution in condition 5 vs. control. Case: Whites	
	ksmirnov rating_white, by(treat5)
	// 	do not reject. 0.000
	tess rating_white treat5, ks 	

*	Test-Hyp16: There will be a difference in item-non-response in condition 1 vs. control. Case: Hispanics
	reg nonresponse_hispanic i.treat1
	// reject. 
	tess 1.treat1, bonf(2)
	
*	Test-Hyp17: There will be a difference in item-non-response in condition 2 vs. control. Case: Hispanics
	reg nonresponse_hispanic i.treat2
	// reject.  
	tess 1.treat2, bonf(2)

	
*	Test-Hyp18: There will be a difference in item-non-response in condition 3 vs. control. Case: Hispanics
	reg nonresponse_hispanic i.treat3
	// reject.  
	tess 1.treat3, bonf(2)
	
*	Test-Hyp19: There will be a difference in item-non-response in condition 4 vs. control. Case: Hispanics
	reg nonresponse_hispanic i.treat4
	// reject. 
	tess 1.treat4, bonf(2)
		
*	Test-Hyp20: There will be a difference in item-non-response in condition 5 vs. control. Case: Hispanics
	reg nonresponse_hispanic i.treat5
	// reject. 
	tess 1.treat5, bonf(2)	

*	Test-Hyp21: There will be a difference in rounding rate in condition 1 vs. control. Case: Hispanics
	reg rounded_hispanic i.treat1
	// do not reject. 0.000
	tess 1.treat1, bonf(2)
	
*	Test-Hyp22: There will be a difference in rounding rate in condition 2 vs. control. Case: Hispanics
	reg rounded_hispanic i.treat2
	// do not reject. 0.000
	tess 1.treat2, bonf(2)
	
*	Test-Hyp23: There will be a difference in rounding rate in condition 3 vs. control. Case: Hispanics
	reg rounded_hispanic i.treat3
	// do not reject. 0.000
	tess 1.treat3, bonf(2)
	
*	Test-Hyp24: There will be a difference in rounding rate in condition 4 vs. control. Case: Hispanics
	reg rounded_hispanic i.treat4
	// do not reject. 0.000
	tess 1.treat4, bonf(2)
		
*	Test-Hyp25: There will be a difference in rounding rate in condition 5 vs. control. Case: Hispanics				
	reg rounded_hispanic i.treat5
	// do not reject. 0.000
	tess 1.treat5, bonf(2)
	
*	Test-Hyp26: There will be a difference in response distribution in condition 1 vs. control. Case: Hispanics
	ksmirnov rating_hispanic, by(treat1)
	// 	do not reject. 0.007
	tess rating_hispanic treat1, ks  
	
*	Test-Hyp27: There will be a difference in response distribution in condition 2 vs. control. Case: Hispanics
	ksmirnov rating_hispanic, by(treat2)	
	// 	do not reject. 0.001
	tess rating_hispanic treat2, ks  
	
*	Test-Hyp28: There will be a difference in response distribution in condition 3 vs. control. Case: Hispanics	
	ksmirnov rating_hispanic, by(treat3)
	// 	do not reject. 	
	tess rating_hispanic treat3, ks  
	
*	Test-Hyp29: There will be a difference in response distribution in condition 4 vs. control. Case: Hispanics	
	ksmirnov rating_hispanic, by(treat4)
	// 	reject. 0.253
	tess rating_hispanic treat4, ks  	
	
*	Test-Hyp30: There will be a difference in response distribution in condition 5 vs. control. Case: Hispanics
	ksmirnov rating_hispanic, by(treat5)
	// 	do not reject. 0.000
	tess rating_hispanic treat5, ks  	
	
*	Test-Hyp31: There will be a difference in item-non-response in condition 1 vs. control. Case: Blacks
	reg nonresponse_black i.treat1
	// reject. 0.0761
	tess 1.treat1, bonf(2)
	
*	Test-Hyp32: There will be a difference in item-non-response in condition 2 vs. control. Case: Blacks
	reg nonresponse_black i.treat2
	// reject. 0.8107
	tess 1.treat2, bonf(2)
	
*	Test-Hyp33: There will be a difference in item-non-response in condition 3 vs. control. Case: Blacks
	reg nonresponse_black i.treat3
	// reject. 0.8849
	tess 1.treat3, bonf(2)
	
*	Test-Hyp34: There will be a difference in item-non-response in condition 4 vs. control. Case: Blacks
	reg nonresponse_black i.treat4
	// reject. 0.2947
	tess 1.treat4, bonf(2)
		
*	Test-Hyp35: There will be a difference in item-non-response in condition 5 vs. control. Case: Blacks
	reg nonresponse_black i.treat5
	// reject. 
	tess 1.treat5, bonf(2)
	
*	Test-Hyp36: There will be a difference in rounding rate in condition 1 vs. control. Case: Blacks
	reg rounded_black i.treat1
	// do not reject. 0.000
	tess 1.treat1, bonf(2)
	
*	Test-Hyp37: There will be a difference in rounding rate in condition 2 vs. control. Case: Blacks
	reg rounded_black i.treat2
	// do not reject. 0.000
	tess 1.treat2, bonf(2)
	
*	Test-Hyp38: There will be a difference in rounding rate in condition 3 vs. control. Case: Blacks
	reg rounded_black i.treat3
	// do not reject. 0.000
	tess 1.treat3, bonf(2)
	
*	Test-Hyp39: There will be a difference in rounding rate in condition 4 vs. control. Case: Blacks
	reg rounded_black i.treat4
	// do not reject. 0.000
	tess 1.treat4, bonf(2)
	
*	Test-Hyp40: There will be a difference in rounding rate in condition 5 vs. control. Case: Blacks				
	reg rounded_black i.treat5
	// do not reject. 0.000
	tess 1.treat5, bonf(2)	
	
*	Test-Hyp41: There will be a difference in response distribution in condition 1 vs. control. Case: Blacks
	ksmirnov rating_black, by(treat1)
	// 	do not reject. 0.003
	tess rating_black treat1, ks  
	
*	Test-Hyp42: There will be a difference in response distribution in condition 2 vs. control. Case: Blacks
	ksmirnov rating_black, by(treat2)
	// 	do not reject. 0.006	
	tess rating_black treat2, ks  
	
*	Test-Hyp43: There will be a difference in response distribution in condition 3 vs. control. Case: Blacks	
	ksmirnov rating_black, by(treat3)
	// 	do not reject. 0.009
	tess rating_black treat3, ks  
	
*	Test-Hyp44: There will be a difference in response distribution in condition 4 vs. control. Case: Blacks	
	ksmirnov rating_black, by(treat4)
	// 	do not reject. 0.039
	tess rating_black treat4, ks  
	
*	Test-Hyp45: There will be a difference in response distribution in condition 5 vs. control. Case: Blacks
	ksmirnov rating_black, by(treat5)
	// 	do not reject. 0.001	
	tess rating_black treat5, ks  
